package com.ruoyi.erp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.BankAccountTransferMapper;
import com.ruoyi.erp.domain.BankAccountTransfer;
import com.ruoyi.erp.service.IBankAccountTransferService;
import com.ruoyi.common.core.text.Convert;

/**
 * 账户间往来Service业务层处理
 * 
 * @author sauger
 * @date 2022-04-01
 */
@Service
public class BankAccountTransferServiceImpl implements IBankAccountTransferService 
{
    @Autowired
    private BankAccountTransferMapper bankAccountTransferMapper;

    /**
     * 查询账户间往来
     * 
     * @param id 账户间往来主键
     * @return 账户间往来
     */
    @Override
    public BankAccountTransfer selectBankAccountTransferById(Integer id)
    {
        return bankAccountTransferMapper.selectBankAccountTransferById(id);
    }

    /**
     * 查询账户间往来列表
     * 
     * @param bankAccountTransfer 账户间往来
     * @return 账户间往来
     */
    @Override
    public List<BankAccountTransfer> selectBankAccountTransferList(BankAccountTransfer bankAccountTransfer)
    {
        return bankAccountTransferMapper.selectBankAccountTransferList(bankAccountTransfer);
    }

    /**
     * 新增账户间往来
     * 
     * @param bankAccountTransfer 账户间往来
     * @return 结果
     */
    @Override
    public int insertBankAccountTransfer(BankAccountTransfer bankAccountTransfer)
    {
        bankAccountTransfer.setCreateTime(DateUtils.getNowDate());
        return bankAccountTransferMapper.insertBankAccountTransfer(bankAccountTransfer);
    }

    /**
     * 修改账户间往来
     * 
     * @param bankAccountTransfer 账户间往来
     * @return 结果
     */
    @Override
    public int updateBankAccountTransfer(BankAccountTransfer bankAccountTransfer)
    {
        return bankAccountTransferMapper.updateBankAccountTransfer(bankAccountTransfer);
    }

    /**
     * 批量删除账户间往来
     * 
     * @param ids 需要删除的账户间往来主键
     * @return 结果
     */
    @Override
    public int deleteBankAccountTransferByIds(String ids)
    {
        return bankAccountTransferMapper.deleteBankAccountTransferByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除账户间往来信息
     * 
     * @param id 账户间往来主键
     * @return 结果
     */
    @Override
    public int deleteBankAccountTransferById(Integer id)
    {
        return bankAccountTransferMapper.deleteBankAccountTransferById(id);
    }
}
